package com.nnxieli.trans.util

import com.hd.trans.track.TrackerListener
import com.hd.trans.utils.LogUtil

/**
 * 埋点回调实现类：
 * 1. 视图事件
 * 2. 统计事件
 * 3. 点击事件
 */
class TrackerImpl: TrackerListener {

    //单例
    companion object {
        private val instance = TrackerImpl()

        @JvmStatic
        fun getInstance(): TrackerImpl {
            return instance
        }
    }

    override fun view(title: String) {
        //上报埋点
        LogUtil.d("TrackerImpl", "视图事件: $title")
    }

    override fun count(title: String, name: String) {
        //上报埋点
        LogUtil.d("TrackerImpl", "统计事件: title=$title, name=$name")
    }

    override fun click(title: String, name: String) {
        //上报埋点
        LogUtil.d("TrackerImpl", "点击事件: title=$title, name=$name")
    }

    override fun click(title: String, tableName: String, name: String) {
        //上报埋点
        LogUtil.d("TrackerImpl", "点击事件: title=$title, tableName=$tableName, name=$name")
    }
}